
#include "CThreadMutex.h"

CThreadMutex::CThreadMutex()
{
	pthread_mutex_init(&m_Mutex, NULL);
}

CThreadMutex::~CThreadMutex()
{
  pthread_mutex_destroy(&m_Mutex);
}

int CThreadMutex::Lock()
{
	return pthread_mutex_lock(&m_Mutex);
}	
	
int CThreadMutex::Unlock()
{
	return pthread_mutex_unlock(&m_Mutex);
}
	
int CThreadMutex::TryLock()
{
  return pthread_mutex_trylock(&m_Mutex);
}

pthread_mutex_t* CThreadMutex::GetThdMutex()
{
  return &m_Mutex;
}

